﻿using System;
using System.Collections.Generic;

namespace libEngineAI.Interfaces
{
	public interface IGame
	{
		/// <summary>
		/// Gets or sets the list of pieces.
		/// </summary>
		/// <value>The pieces.</value>
		IEnumerable<IPiece> Pieces { get; set; }

		/// <summary>
		/// Gets or sets the turn.
		/// </summary>
		/// <value>The turn.</value>
		TeamEnum Turn { get; set; }

		/// <summary>
		/// Gets or sets the white player.
		/// </summary>
		/// <value>The white player.</value>
		IPlayer WhitePlayer { get; set; }

		/// <summary>
		/// Gets or sets the black player.
		/// </summary>
		/// <value>The black player.</value>
		IPlayer BlackPlayer { get; set; } 

		/// <summary>
		/// Gets or sets the board.
		/// </summary>
		/// <value>The board.</value>
		IBoard Board { get; set; }

		/// <summary>
		/// Initialize this instance.
		/// </summary>
		void Initialize();

		/// <summary>
		/// Start the Game
		/// Is the main loop
		/// </summary>
		void Start();

		/// <summary>
		/// Generate all valid moves for each piece in the turn
		/// </summary>
		IEnumerable<Movement> GenerateMoves();

		/// <summary>
		/// Do the move.
		/// </summary>
		void DoMove( Movement m );

		/// <summary>
		/// Undo the move.
		/// </summary>
		void UndoMove( Movement m );

		/// <summary>
		/// Changes the turn.
		/// </summary>
		/// <returns>The turn.</returns>
		TeamEnum ChangeTurn();

		/// <summary>
		/// Evaluate the game
		/// </summary>
		int Evaluate();

		/// <summary>
		/// Check if there is a winner
		/// </summary>
		TeamEnum Winner();

		/// <summary>
		/// Gets the hash.
		/// </summary>
		/// <returns>The hash.</returns>
		Int64 GetHash();
	}
}

